package com.xmkj.jijidriver.order;

import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.util.SparseArray;

import com.common.mvp.BaseMvpActivity;
import com.common.mvp.BasePresenter;
import com.xmkj.jijidriver.R;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by chen on 2018/4/7.
 */

public class OrderDetailActivity extends BaseMvpActivity {
    @BindView(R.id.tab_layout)
    TabLayout tabLayout;
    @BindView(R.id.view_pager)
    ViewPager viewPager;
    SparseArray<String> titles = new SparseArray<>();
    @Override
    protected BasePresenter createPresenterInstance() {
        return null;
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_order;
    }

    @Override
    protected void onViewCreated() {

    }

    @Override
    protected void doLogicFunc() {
        initTab();
    }
    private void initTab() {
        tabLayout.setTabMode(TabLayout.MODE_SCROLLABLE);
        titles.append(0, "当日订单");
        titles.append(1, "昨日订单");
        titles.append(2, "当月订单");
        titles.append(3, "上月订单");
        viewPager.setAdapter(new OrderPagerAdapter(getSupportFragmentManager(), titles,context));
        tabLayout.setupWithViewPager(viewPager);
    }
    @Override
    protected void setNavigation() {
        setNavigationBack("订单明细");
    }
    @Override
    public void bindKnife() {
        ButterKnife.bind(this);

    }
}
